<!DOCTYPE HTML>
<html>
<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" type="text/css" href="__CSS__/main.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/common.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/bootstrap.min.css" />
    <link rel="stylesheet" type="text/css" href="__CSS__/font-awesome.css" />
    <script type="text/javascript" src="__EXTEND__/lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="__EXTEND__/js/bootstrap.min.js"></script>
    <script type="text/javascript" src="__EXTEND__/lib/layer/2.4/layer.js"></script>
    <![endif]-->
    <title></title>
</head>
<body>
<div class="contant"><div class="row"> <h3 class="page-header">节点管理</h3></div>
<div class="row">
    <div class="col-md-12">
        <div class="panel panel-default">
            <div class="panel-body">
            	<label><a class="btn btn-primary" href="{:U('Node/add')}">添加节点</a></label>
                <div class="table-responsive">
                    <table class="table table-striped table-bordered table-hover">
                        <thead>
                        	<tr>
                           		<th width="60"></th>
                                <th>节点名称</th>
                                <th>节点路径</th>
                                <th width="75">排序</th>
                                <th width="75">状态</th>
                                <th width="120">操作</th>
                            </tr>
                        </thead>
                        <tbody>
                            <volist name="list" id="list">
	                            <tr class="level{$list.pid} <gt name='list.pid' value='0'> hide </gt>"  >
                                    <if condition="$list.pid lt 1">
                                        <td>
                                            <i data-id="{$list.id}" data-open='1' class="fa <lt name='list.type' value='2'> fa-plus open </lt>"></i>
                                        </td>
                                    <else />
                                        <td></td>
                                    </if>
	                                <td>
                                       <switch name='list.type'>
                                           <case value="0"></case>
                                           <case value="1">&nbsp;<i class="fa fa-long-arrow-right" aria-hidden="true"></i>&nbsp;</case>
                                           <case value="2">
                                               &nbsp;<i class="fa fa-long-arrow-right" aria-hidden="true"></i>&nbsp;
                                               &nbsp;<i class="fa fa-long-arrow-right" aria-hidden="true"></i>&nbsp;
                                           </case>
                                       </switch>{$list.title}
                                    </td>
	                                <td>
                                        <switch name='list.type'>
                                            <case value="0">&nbsp;|-&nbsp;&nbsp;&nbsp;</case>
                                            <case value="1">&nbsp;|&nbsp;&nbsp;&nbsp;|-&nbsp;&nbsp;&nbsp;</case>
                                            <case value="2">&nbsp;|&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;|-&nbsp;&nbsp;&nbsp;</case>
                                        </switch>{$list.name}
                                    </td>
	                                <td>
                                        <input class="setSort" type="text" size="5" data-url="{:U('Node/setSort?id='.$list['id'])}" value="{$list.sort}">
                                    </td>
	                                <td>
                                        <button class='btn <eq name="list.status" value="1">btn-primary<else />btn-default</eq> btn-sm setStatus' type="button" data-url='{:U("Node/setStatus?id=".$list["id"])}' data-status="{$list.status}"><eq name="list.status" value='1'>启用<else />禁用</eq></button>
                                    </td>
	                                <td>
	                                    <a class="btn-sm btn btn-default" href='{:U("Node/edit?id=".$list["id"])}'>修改</a>
	                                    <button data-url='{:U("Node/del?id=".$list["id"])}' class="btn-sm btn btn-default delBtn" type="button">删除</button>
	                                </td>
	                            </tr>
                            </volist>
                        </tbody>
                    </table>
                </div>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
	$(function(){
		$('.open').click(function(){
			if($(this).data('open') == 0){
				$(this).removeClass('fa-minus').addClass('fa-plus');
				$('.level'+$(this).data('id')).addClass('hide');
			}else{
				$(this).removeClass('fa-plus').addClass('fa-minus');
				$('.level'+$(this).data('id')).removeClass('hide');
			}
			$(this).data('open', $(this).data('open') == 1 ? 0 : 1);
		});
	})
</script>
</div>
</body>
</html>